<template>
	<u-modal v-model="show" confirm-text="确定" title="协议内容" @cancel="cancel" @confirm="confirm">
		<view class="u-update-content">
			<u-parse style="height: 1000rpx; overflow: auto; padding: 20rpx;" :html="content"></u-parse>
		</view>
	</u-modal>
</template>

<script>
	export default {
		data() {
			return {
				show: true,
				// 传递给uni-app"rich-text"组件的内容，可以使用"<br>"进行换行
				content: '',
			}
		},
		onReady() {
			this.agreement()
			this.show = true;
		},
		methods: {
			agreement() {
				this.$u.api.getConfigInfo({
					key: "agreement"
				}).then(res => {
					console.log(res)
					this.content = res.data.content
				})
			},
			cancel() {
				this.closeModal();
			},
			confirm() {
				this.closeModal();
			},
			closeModal() {
				// this.$u.route('/pages/login/login');
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.u-full-content {
		background-color: #00C777;
	}

	.u-update-content {
		font-size: 26rpx;
		color: $u-content-color;
		line-height: 1.7;
		padding: 30rpx;
	}
</style>
